package classesInterface;

public class JanelaPermissoes extends javax.swing.JFrame {

    /**
     * Creates new form Permissoes
     */
    private JanelaPermissoes() {
        initComponents();
    }
    
    public static JanelaPermissoes getInstance(){
        if(uniqueInstance == null){
            uniqueInstance = new JanelaPermissoes();
        }
        return uniqueInstance;
    }
    
    public void setTipo(String tipo){
       
        this.tipo = tipo;
        jLabel1.setText("Mudando permissões para o tipo de usuário: " + tipo);
        
    }
    
    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        admissaoMedica = new javax.swing.JCheckBox();
        atendPsiq = new javax.swing.JCheckBox();
        clinMed = new javax.swing.JCheckBox();
        encamIntern = new javax.swing.JCheckBox();
        encamEgress = new javax.swing.JCheckBox();
        encamOutros = new javax.swing.JCheckBox();
        evolMultid = new javax.swing.JCheckBox();
        evolRelatEnferm = new javax.swing.JCheckBox();
        histEnferm = new javax.swing.JCheckBox();
        internamento = new javax.swing.JCheckBox();
        solicitAutorizacao = new javax.swing.JCheckBox();
        notifInfeccao = new javax.swing.JCheckBox();
        obsProntAtd = new javax.swing.JCheckBox();
        prescClinmed = new javax.swing.JCheckBox();
        doseIndiv = new javax.swing.JCheckBox();
        terapIndiv = new javax.swing.JCheckBox();
        sistAssistEnferm = new javax.swing.JCheckBox();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("Mudando permissões para o tipo de usuário:");

        admissaoMedica.setText("Ficha de Admissão Médica");

        atendPsiq.setText("Ficha de Atendimento Psiquiátrico de Urgência");

        clinMed.setText("Ficha de Clínica Médica");

        encamIntern.setText("Ficha de Encaminhamento e Internação em Hospital Psiquiátrico");

        encamEgress.setText("Ficha de Encaminhamento de Egresso");

        encamOutros.setText("Ficha de Encaminhamento para Outros Serviços da Rede");

        evolMultid.setText("Ficha de Evolução Multidisciplinar");

        evolRelatEnferm.setText("Ficha de Evolução e Relatório do Técnico de Enfermagem");

        histEnferm.setText("Ficha de Histórico de Enfermagem");

        internamento.setText("Ficha de Internamento");

        solicitAutorizacao.setText("Laudo para Solicitação de Autorização de Internação Hospitalar");

        notifInfeccao.setText("Ficha de Notificação de Infecão");

        obsProntAtd.setText("Ficha de Observação no Pronto Atendimento");

        prescClinmed.setText("Ficha de Prescrição de Clínica Médica");

        doseIndiv.setText("Ficha de Prescrição Médica - Dose Individualizada");

        terapIndiv.setText("Ficha de Projeto Terapêutico Individual");

        sistAssistEnferm.setText("Ficha de Sistematização da Assistência de Enfermagem");

        jButton1.setText("Selecionar Tudo");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Desselecionar Tudo");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Cancelar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("Salvar");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(atendPsiq)
                    .addComponent(jLabel1)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(admissaoMedica)
                            .addComponent(clinMed)
                            .addComponent(encamIntern)
                            .addComponent(encamEgress)
                            .addComponent(encamOutros)
                            .addComponent(evolMultid)
                            .addComponent(evolRelatEnferm)
                            .addComponent(histEnferm))
                        .addGap(30, 30, 30)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(sistAssistEnferm)
                            .addComponent(terapIndiv)
                            .addComponent(doseIndiv)
                            .addComponent(prescClinmed)
                            .addComponent(obsProntAtd)
                            .addComponent(notifInfeccao)
                            .addComponent(solicitAutorizacao)
                            .addComponent(internamento)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jButton1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton4)))))
                .addContainerGap(20, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(29, 29, 29)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(admissaoMedica)
                    .addComponent(internamento))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(atendPsiq)
                    .addComponent(solicitAutorizacao))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(clinMed)
                    .addComponent(notifInfeccao))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(encamIntern)
                    .addComponent(obsProntAtd))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(encamEgress)
                    .addComponent(prescClinmed))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(encamOutros)
                    .addComponent(doseIndiv))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(evolMultid)
                    .addComponent(terapIndiv))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(evolRelatEnferm)
                    .addComponent(sistAssistEnferm))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(histEnferm)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jButton2)
                    .addComponent(jButton3)
                    .addComponent(jButton4))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        admissaoMedica.setSelected(true);
        atendPsiq.setSelected(true);
        clinMed.setSelected(true);
        doseIndiv.setSelected(true);
        encamEgress.setSelected(true);
        encamIntern.setSelected(true);
        encamOutros.setSelected(true);
        evolMultid.setSelected(true);
        evolRelatEnferm.setSelected(true);
        histEnferm.setSelected(true);
        internamento.setSelected(true);
        notifInfeccao.setSelected(true);
        obsProntAtd.setSelected(true);
        prescClinmed.setSelected(true);
        sistAssistEnferm.setSelected(true);
        solicitAutorizacao.setSelected(true);
        terapIndiv.setSelected(true);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        admissaoMedica.setSelected(false);
        atendPsiq.setSelected(false);
        clinMed.setSelected(false);
        doseIndiv.setSelected(false);
        encamEgress.setSelected(false);
        encamIntern.setSelected(false);
        encamOutros.setSelected(false);
        evolMultid.setSelected(false);
        evolRelatEnferm.setSelected(false);
        histEnferm.setSelected(false);
        internamento.setSelected(false);
        notifInfeccao.setSelected(false);
        obsProntAtd.setSelected(false);
        prescClinmed.setSelected(false);
        sistAssistEnferm.setSelected(false);
        solicitAutorizacao.setSelected(false);
        terapIndiv.setSelected(false);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        boolean badmissaoMedica = admissaoMedica.isSelected();
        boolean batendPsiq = atendPsiq.isSelected();
        boolean bclinMed = clinMed.isSelected();
        boolean bdoseIndiv = doseIndiv.isSelected();
        boolean bencamEgress = encamEgress.isSelected();
        boolean bencamIntern = encamIntern.isSelected();
        boolean bencamOutros = encamOutros.isSelected();
        boolean bevolMultid = evolMultid.isSelected();
        boolean bevolRelatEnferm = evolRelatEnferm.isSelected();
        boolean bhistEnferm = histEnferm.isSelected();
        boolean binternamento = internamento.isSelected();
        boolean bnotifInfeccao = notifInfeccao.isSelected();
        boolean bobsProntAtd = obsProntAtd.isSelected();
        boolean bprescClinmed = prescClinmed.isSelected();
        boolean bsistAssistEnferm = sistAssistEnferm.isSelected();
        boolean bsolicitAutorizacao = solicitAutorizacao.isSelected();
        boolean bterapIndiv = terapIndiv.isSelected();

        
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        setVisible(false);
    }//GEN-LAST:event_jButton3ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JanelaPermissoes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JanelaPermissoes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JanelaPermissoes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JanelaPermissoes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JanelaPermissoes().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox admissaoMedica;
    private javax.swing.JCheckBox atendPsiq;
    private javax.swing.JCheckBox clinMed;
    private javax.swing.JCheckBox doseIndiv;
    private javax.swing.JCheckBox encamEgress;
    private javax.swing.JCheckBox encamIntern;
    private javax.swing.JCheckBox encamOutros;
    private javax.swing.JCheckBox evolMultid;
    private javax.swing.JCheckBox evolRelatEnferm;
    private javax.swing.JCheckBox histEnferm;
    private javax.swing.JCheckBox internamento;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JCheckBox notifInfeccao;
    private javax.swing.JCheckBox obsProntAtd;
    private javax.swing.JCheckBox prescClinmed;
    private javax.swing.JCheckBox sistAssistEnferm;
    private javax.swing.JCheckBox solicitAutorizacao;
    private javax.swing.JCheckBox terapIndiv;
    // End of variables declaration//GEN-END:variables
    private static String tipo;
    private static JanelaPermissoes uniqueInstance = null;
}
